import Button from './button/index.js'
import Cascader from './cascader/index.js'
import datePicker from './date-picker/index.js'
import form from './form/index.js'
import input from './input/index.js'
import InputMulti from './input-multi-tag/index.js'
import pagination from './pagination/index.js'
import radio from './radio/index.js'
import select from './select/index.js'
import Switch from './switch/index.js'
import table from './table/index.js'
import Tree from './tree/index.js'
import checkbox from './checkbox/index.js'
import menu from './menu/index.js'
import Tag from './tag/index.js'
import TreeSelect from './tree-select/index.js'
import dropdown from './dropdown/index.js'
import modal from './modal/index.js'
import Divider from './divider/index.js'
import tabs from './tabs/index.js'
import Row from './row/row.js'
import Col from './col/col.js'
import InputNumber from './input-number/input-number.js'
import timePicker from './time-picker/index.js'
import Upload from './upload/upload.js'
import UploadDragger from './upload/upload-dragger.js'
import ConfigProvider from './config-provider/config-provider.js'
import Rate from './rate/index.js'
import dayjs from 'dayjs'
import 'dayjs/locale/zh-cn'
import locale from '../es/locale-provider/zh_CN.js'
import Space from './space/index.js'
import { message, Modal, notification } from 'ant-design-vue'
import Popconfirm from './popconfirm/index.js'
import Calendar from './calendar/index.js'
import Tooltip from './tooltip/index.js'
import CollapsePanel from './collapse/collapse-panel'
import Collapse from './collapse/collapse'
import Popover from './popover/index.js'
import Transfer from './transfer/transfer'
import Spin from './spin/index.js'
import breadcrumb from './breadcrumb/index.js'
import PageHeader from './page-header/index.js'
import steps from './steps/index.js'
import BackTop from './back-top/index.js'
import Result from './result/index.js'
import Progress from './progress/index.js'
import Drawer from './drawer/index.js'
import layout from './layout/index.js'
import anchor from './anchor/index.js'
import list from './list/index.js'
import avatar from './avatar/index.js'
import card from './card/index.js'
import Skeleton from './skeleton/skeleton.js'
import SkeletonButton from './skeleton/skeleton-button.js'
import SkeletonInput from './skeleton/skeleton-input.js'
import SkeletonAvatar from './skeleton/skeleton-avatar.js'
import SkeletonImage from './skeleton/skeleton-image.js'
import Badge from './badge/badge.js'
import BadgeRibbon from './badge/badge-ribbon.js'
import timeline from './timeline/timeline.js'
import timelineItem from './timeline/timeline-item.js'
import statistic from './statistic/statistic.js'
import statisticCountdown from './statistic/statistic-countdown.js'
import alert from './alert/index.js'
import image from './image/image.js'
import imageGroup from './image/image-group.js'
import empty from './empty/empty.js'
import descriptions from './descriptions/descriptions.js'
import descriptionsItem from './descriptions/descriptions-item.js'
import affix from './affix/affix.js'
import slider from './slider/slider.js'
import comment from './comment/comment.js'
import mentions from './mentions/mentions.js'
import mentionsOption from './mentions/mentions-option.js'
import watermark from './watermark/index.js'
import icon from './icon/icon.js'
import autoComplete from './auto-complete/index.js'
import carousel from './carousel/index.js'

const Radio = radio.radio
const RadioButton = radio.radioButton
const RadioGroup = radio.radioGroup
const Input = input.input
const Password = input.password
const Search = input.search
const Textarea = input.textarea
const InputGroup = input.inputGroup
const Select = select.select
const SelectOption = select.selectOption
const selectOptGroup = select.selectOptGroup
const Pagination = pagination.pagination
const PaginationBg = pagination.paginationBg
const DatePicker = datePicker.datePicker
const RangePicker = datePicker.rangePicker
const Form = form.form
const FormItem = form.formItem
const Table = table.table
const TableSelect = table.tableSelect
const TableSummary = table.tableSummary
const TableSummaryRow = table.tableSummaryRow
const TableSummaryCell = table.tableSummaryCell
const Checkbox = checkbox.checkbox
const CheckboxGroup = checkbox.checkboxGroup
const Menu = menu.menu
const MenuItem = menu.menuItem
const SubMenu = menu.subMenu
const MenuDivider = menu.menuDivider
const MenuGroup = menu.menuGroup
const Dropdown = dropdown.dropdown
const DropdownBtn = dropdown.dropdownBtn
const Tabs = tabs.tabs
const TabPane = tabs.tabPane
const TimePicker = timePicker.timePicker
const TimeRangePicker = timePicker.timeRangePicker
const Breadcrumb = breadcrumb.breadcrumb
const BreadcrumbItem = breadcrumb.breadcrumbItem
const BreadcrumbSeparator = breadcrumb.breadcrumbSeparator
const Step = steps.step
const Steps = steps.steps
const Layout = layout.layout
const LayoutHeader = layout.layoutHeader
const LayoutFooter = layout.layoutFooter
const LayoutContent = layout.layoutContent
const LayoutSider = layout.layoutSider
const Anchor = anchor.anchor
const AnchorLink = anchor.anchorLink
const List = list.list
const ListItem = list.listItem
const ListItemMeta = list.listItemMeta
const Avatar = avatar.avatar
const AvatarGroup = avatar.avatarGroup
const Card = card.card
const CardGrid = card.cardGrid
const CardMeta = card.cardMeta
const components = {
  Button,
  Radio,
  RadioButton,
  RadioGroup,
  Input,
  Password,
  Search,
  Textarea,
  InputGroup,
  Select,
  SelectOption,
  selectOptGroup,
  TreeSelect,
  Cascader,
  Tag,
  Tree,
  Switch,
  Pagination,
  PaginationBg,
  DatePicker,
  RangePicker,
  Form,
  FormItem,
  Table,
  TableSelect,
  TableSummary,
  TableSummaryRow,
  TableSummaryCell,
  Checkbox,
  CheckboxGroup,
  Menu,
  MenuItem,
  SubMenu,
  MenuDivider,
  MenuGroup,
  Dropdown,
  DropdownBtn,
  Tabs,
  TabPane,
  modal,
  Divider,
  Row,
  Col,
  InputNumber,
  InputMulti,
  TimePicker,
  TimeRangePicker,
  Upload,
  UploadDragger,
  ConfigProvider,
  Rate,
  Space,
  Popconfirm,
  Calendar,
  Tooltip,
  CollapsePanel,
  Collapse,
  Popover,
  Transfer,
  Spin,
  Breadcrumb,
  BreadcrumbItem,
  BreadcrumbSeparator,
  PageHeader,
  Steps,
  Step,
  BackTop,
  Result,
  Progress,
  Drawer,
  Layout,
  LayoutHeader,
  LayoutFooter,
  LayoutContent,
  LayoutSider,
  Anchor,
  AnchorLink,
  List,
  ListItem,
  ListItemMeta,
  Avatar,
  AvatarGroup,
  Card,
  CardGrid,
  CardMeta,
  Skeleton,
  SkeletonButton,
  SkeletonInput,
  SkeletonAvatar,
  SkeletonImage,
  Badge,
  BadgeRibbon,
  timeline,
  timelineItem,
  statistic,
  statisticCountdown,
  alert,
  image,
  imageGroup,
  empty,
  descriptions,
  descriptionsItem,
  affix,
  slider,
  comment,
  mentions,
  mentionsOption,
  watermark,
  icon,
  autoComplete,
  carousel
}

const install = function(Vue) {
  Object.keys(components).forEach(key => {
    Vue.component(components[key].name, components[key])
  })
  Vue.config.globalProperties.$dayjs = dayjs
  Vue.config.globalProperties.locale = locale
  Vue.config.globalProperties.$message = message
  Vue.config.globalProperties.$modal = Modal
  Vue.config.globalProperties.$notification = notification
}

if (typeof window !== 'undefined' && window.Vue) {
  install(window.Vue)
}

export default {
  install
}

export {
  message,
  notification,
  Button,
  Radio,
  RadioButton,
  RadioGroup,
  Input,
  InputMulti,
  Password,
  Search,
  Textarea,
  InputGroup,
  Select,
  SelectOption,
  selectOptGroup,
  TreeSelect,
  Cascader,
  Tag,
  Tree,
  Switch,
  Pagination,
  PaginationBg,
  DatePicker,
  RangePicker,
  Form,
  FormItem,
  Table,
  TableSelect,
  TableSummary,
  TableSummaryRow,
  TableSummaryCell,
  Checkbox,
  CheckboxGroup,
  Menu,
  MenuItem,
  SubMenu,
  MenuDivider,
  MenuGroup,
  Dropdown,
  DropdownBtn,
  Tabs,
  TabPane,
  modal,
  Modal,
  Divider,
  Row,
  Col,
  InputNumber,
  TimePicker,
  TimeRangePicker,
  Upload,
  UploadDragger,
  ConfigProvider,
  Rate,
  Space,
  Popconfirm,
  Calendar,
  Tooltip,
  CollapsePanel,
  Collapse,
  Popover,
  Transfer,
  Spin,
  Breadcrumb,
  BreadcrumbItem,
  BreadcrumbSeparator,
  PageHeader,
  Steps,
  Step,
  BackTop,
  Result,
  Progress,
  Drawer,
  Layout,
  LayoutHeader,
  LayoutFooter,
  LayoutContent,
  LayoutSider,
  Anchor,
  AnchorLink,
  List,
  ListItem,
  ListItemMeta,
  Avatar,
  AvatarGroup,
  Card,
  CardGrid,
  CardMeta,
  Skeleton,
  SkeletonButton,
  SkeletonInput,
  SkeletonAvatar,
  SkeletonImage,
  Badge,
  BadgeRibbon,
  timeline,
  timelineItem,
  statistic,
  statisticCountdown,
  alert,
  image,
  imageGroup,
  empty,
  descriptions,
  descriptionsItem,
  affix,
  slider,
  comment,
  mentions,
  mentionsOption,
  watermark,
  icon,
  autoComplete,
  carousel
}
